from keras import Input
from keras.initializers import Constant
from keras.layers import Embedding, Bidirectional, LSTM, Dropout, TimeDistributed
from pre_process import get_embedding_matrix
from config import *
from decoder_cus import LSTM_D

embedding_matrix = get_embedding_matrix()

input = Input(shape=(MAXLEN))
embed_layer = Embedding(input_dim=WORD_DICT_SIZE + 1, output_dim=EMBEDDING_DIM,
                  input_length=MAXLEN, embeddings_initializer=Constant(embedding_matrix),
                  trainable=False)
embed_output = embed_layer(input)

# embed_output = Dropout(0.3)(embed_output)
bi_lstm_layer = Bidirectional(LSTM(LSTM_UNITS, return_state=True, return_sequences=True))
bi_lstm_output, bi_lstm_h, bi_lstm_c = bi_lstm_layer(embed_output)

decoder_layer = TimeDistributed(LSTM_D())

LSTM(go_backwards=True)